
/* Includes ------------------------------------------------------------------*/
#include "jpeg_utils.h"

#ifdef MICROPY_ENABLE_JPEG_UTILS


#define CLAMP(value) 			CLAMP_LUT[value]			//颜色查询表 

#if JPEG_BYTES_PER_PIXEL==2	//RGB565输出时,采用下面的数组

const uint16_t CLAMP_LUT[]=
{
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0800,0X0800,0X0800,0X0800,0X0800,0X0800,0X0800,0X0800,
0X1000,0X1000,0X1000,0X1000,0X1000,0X1000,0X1000,0X1000,0X1800,0X1800,0X1800,0X1800,0X1800,0X1800,0X1800,0X1800,
0X2000,0X2000,0X2000,0X2000,0X2000,0X2000,0X2000,0X2000,0X2800,0X2800,0X2800,0X2800,0X2800,0X2800,0X2800,0X2800,
0X3000,0X3000,0X3000,0X3000,0X3000,0X3000,0X3000,0X3000,0X3800,0X3800,0X3800,0X3800,0X3800,0X3800,0X3800,0X3800,
0X4000,0X4000,0X4000,0X4000,0X4000,0X4000,0X4000,0X4000,0X4800,0X4800,0X4800,0X4800,0X4800,0X4800,0X4800,0X4800,
0X5000,0X5000,0X5000,0X5000,0X5000,0X5000,0X5000,0X5000,0X5800,0X5800,0X5800,0X5800,0X5800,0X5800,0X5800,0X5800,
0X6000,0X6000,0X6000,0X6000,0X6000,0X6000,0X6000,0X6000,0X6800,0X6800,0X6800,0X6800,0X6800,0X6800,0X6800,0X6800,
0X7000,0X7000,0X7000,0X7000,0X7000,0X7000,0X7000,0X7000,0X7800,0X7800,0X7800,0X7800,0X7800,0X7800,0X7800,0X7800,
0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8800,0X8800,0X8800,0X8800,0X8800,0X8800,0X8800,0X8800,
0X9000,0X9000,0X9000,0X9000,0X9000,0X9000,0X9000,0X9000,0X9800,0X9800,0X9800,0X9800,0X9800,0X9800,0X9800,0X9800,
0XA000,0XA000,0XA000,0XA000,0XA000,0XA000,0XA000,0XA000,0XA800,0XA800,0XA800,0XA800,0XA800,0XA800,0XA800,0XA800,
0XB000,0XB000,0XB000,0XB000,0XB000,0XB000,0XB000,0XB000,0XB800,0XB800,0XB800,0XB800,0XB800,0XB800,0XB800,0XB800,
0XC000,0XC000,0XC000,0XC000,0XC000,0XC000,0XC000,0XC000,0XC800,0XC800,0XC800,0XC800,0XC800,0XC800,0XC800,0XC800,
0XD000,0XD000,0XD000,0XD000,0XD000,0XD000,0XD000,0XD000,0XD800,0XD800,0XD800,0XD800,0XD800,0XD800,0XD800,0XD800,
0XE000,0XE000,0XE000,0XE000,0XE000,0XE000,0XE000,0XE000,0XE800,0XE800,0XE800,0XE800,0XE800,0XE800,0XE800,0XE800,
0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,
0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,
0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,
0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,
0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,
0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,
0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,
0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,
0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,
0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,
0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,
0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,
0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,
0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,
0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,
0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,
0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800, 
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0020,0X0020,0X0020,0X0020,0X0040,0X0040,0X0040,0X0040,0X0060,0X0060,0X0060,0X0060,
0X0080,0X0080,0X0080,0X0080,0X00A0,0X00A0,0X00A0,0X00A0,0X00C0,0X00C0,0X00C0,0X00C0,0X00E0,0X00E0,0X00E0,0X00E0,
0X0100,0X0100,0X0100,0X0100,0X0120,0X0120,0X0120,0X0120,0X0140,0X0140,0X0140,0X0140,0X0160,0X0160,0X0160,0X0160,
0X0180,0X0180,0X0180,0X0180,0X01A0,0X01A0,0X01A0,0X01A0,0X01C0,0X01C0,0X01C0,0X01C0,0X01E0,0X01E0,0X01E0,0X01E0,
0X0200,0X0200,0X0200,0X0200,0X0220,0X0220,0X0220,0X0220,0X0240,0X0240,0X0240,0X0240,0X0260,0X0260,0X0260,0X0260,
0X0280,0X0280,0X0280,0X0280,0X02A0,0X02A0,0X02A0,0X02A0,0X02C0,0X02C0,0X02C0,0X02C0,0X02E0,0X02E0,0X02E0,0X02E0,
0X0300,0X0300,0X0300,0X0300,0X0320,0X0320,0X0320,0X0320,0X0340,0X0340,0X0340,0X0340,0X0360,0X0360,0X0360,0X0360,
0X0380,0X0380,0X0380,0X0380,0X03A0,0X03A0,0X03A0,0X03A0,0X03C0,0X03C0,0X03C0,0X03C0,0X03E0,0X03E0,0X03E0,0X03E0,
0X0400,0X0400,0X0400,0X0400,0X0420,0X0420,0X0420,0X0420,0X0440,0X0440,0X0440,0X0440,0X0460,0X0460,0X0460,0X0460,
0X0480,0X0480,0X0480,0X0480,0X04A0,0X04A0,0X04A0,0X04A0,0X04C0,0X04C0,0X04C0,0X04C0,0X04E0,0X04E0,0X04E0,0X04E0,
0X0500,0X0500,0X0500,0X0500,0X0520,0X0520,0X0520,0X0520,0X0540,0X0540,0X0540,0X0540,0X0560,0X0560,0X0560,0X0560,
0X0580,0X0580,0X0580,0X0580,0X05A0,0X05A0,0X05A0,0X05A0,0X05C0,0X05C0,0X05C0,0X05C0,0X05E0,0X05E0,0X05E0,0X05E0,
0X0600,0X0600,0X0600,0X0600,0X0620,0X0620,0X0620,0X0620,0X0640,0X0640,0X0640,0X0640,0X0660,0X0660,0X0660,0X0660,
0X0680,0X0680,0X0680,0X0680,0X06A0,0X06A0,0X06A0,0X06A0,0X06C0,0X06C0,0X06C0,0X06C0,0X06E0,0X06E0,0X06E0,0X06E0,
0X0700,0X0700,0X0700,0X0700,0X0720,0X0720,0X0720,0X0720,0X0740,0X0740,0X0740,0X0740,0X0760,0X0760,0X0760,0X0760,
0X0780,0X0780,0X0780,0X0780,0X07A0,0X07A0,0X07A0,0X07A0,0X07C0,0X07C0,0X07C0,0X07C0,0X07E0,0X07E0,0X07E0,0X07E0,
0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,
0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,
0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,
0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,
0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,
0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,
0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,
0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,
0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,
0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,
0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,
0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,
0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,
0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,
0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,
0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0,0X07E0, 
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,
0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0001,0X0001,0X0001,0X0001,0X0001,0X0001,0X0001,0X0001,
0X0002,0X0002,0X0002,0X0002,0X0002,0X0002,0X0002,0X0002,0X0003,0X0003,0X0003,0X0003,0X0003,0X0003,0X0003,0X0003,
0X0004,0X0004,0X0004,0X0004,0X0004,0X0004,0X0004,0X0004,0X0005,0X0005,0X0005,0X0005,0X0005,0X0005,0X0005,0X0005,
0X0006,0X0006,0X0006,0X0006,0X0006,0X0006,0X0006,0X0006,0X0007,0X0007,0X0007,0X0007,0X0007,0X0007,0X0007,0X0007,
0X0008,0X0008,0X0008,0X0008,0X0008,0X0008,0X0008,0X0008,0X0009,0X0009,0X0009,0X0009,0X0009,0X0009,0X0009,0X0009,
0X000A,0X000A,0X000A,0X000A,0X000A,0X000A,0X000A,0X000A,0X000B,0X000B,0X000B,0X000B,0X000B,0X000B,0X000B,0X000B,
0X000C,0X000C,0X000C,0X000C,0X000C,0X000C,0X000C,0X000C,0X000D,0X000D,0X000D,0X000D,0X000D,0X000D,0X000D,0X000D,
0X000E,0X000E,0X000E,0X000E,0X000E,0X000E,0X000E,0X000E,0X000F,0X000F,0X000F,0X000F,0X000F,0X000F,0X000F,0X000F,
0X0010,0X0010,0X0010,0X0010,0X0010,0X0010,0X0010,0X0010,0X0011,0X0011,0X0011,0X0011,0X0011,0X0011,0X0011,0X0011,
0X0012,0X0012,0X0012,0X0012,0X0012,0X0012,0X0012,0X0012,0X0013,0X0013,0X0013,0X0013,0X0013,0X0013,0X0013,0X0013,
0X0014,0X0014,0X0014,0X0014,0X0014,0X0014,0X0014,0X0014,0X0015,0X0015,0X0015,0X0015,0X0015,0X0015,0X0015,0X0015,
0X0016,0X0016,0X0016,0X0016,0X0016,0X0016,0X0016,0X0016,0X0017,0X0017,0X0017,0X0017,0X0017,0X0017,0X0017,0X0017,
0X0018,0X0018,0X0018,0X0018,0X0018,0X0018,0X0018,0X0018,0X0019,0X0019,0X0019,0X0019,0X0019,0X0019,0X0019,0X0019,
0X001A,0X001A,0X001A,0X001A,0X001A,0X001A,0X001A,0X001A,0X001B,0X001B,0X001B,0X001B,0X001B,0X001B,0X001B,0X001B,
0X001C,0X001C,0X001C,0X001C,0X001C,0X001C,0X001C,0X001C,0X001D,0X001D,0X001D,0X001D,0X001D,0X001D,0X001D,0X001D,
0X001E,0X001E,0X001E,0X001E,0X001E,0X001E,0X001E,0X001E,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,
0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,
0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,
0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,
0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,
0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,
0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,
0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,
0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,
0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,
0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,
0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,
0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,
0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,
0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,
0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,
0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,0X001F,
};
//Cr to Red color conversion Look Up Table
const uint32_t CR_RED_LUT[]=
{
0X0000004D,0X0000004E,0X0000004F,0X00000051,0X00000052,0X00000054,0X00000055,0X00000056,
0X00000058,0X00000059,0X0000005B,0X0000005C,0X0000005D,0X0000005F,0X00000060,0X00000062,
0X00000063,0X00000064,0X00000066,0X00000067,0X00000069,0X0000006A,0X0000006B,0X0000006D,
0X0000006E,0X00000070,0X00000071,0X00000072,0X00000074,0X00000075,0X00000077,0X00000078,
0X00000079,0X0000007B,0X0000007C,0X0000007E,0X0000007F,0X00000080,0X00000082,0X00000083,
0X00000085,0X00000086,0X00000087,0X00000089,0X0000008A,0X0000008C,0X0000008D,0X0000008E,
0X00000090,0X00000091,0X00000093,0X00000094,0X00000095,0X00000097,0X00000098,0X0000009A,
0X0000009B,0X0000009C,0X0000009E,0X0000009F,0X000000A1,0X000000A2,0X000000A3,0X000000A5,
0X000000A6,0X000000A8,0X000000A9,0X000000AA,0X000000AC,0X000000AD,0X000000AF,0X000000B0,
0X000000B1,0X000000B3,0X000000B4,0X000000B6,0X000000B7,0X000000B8,0X000000BA,0X000000BB,
0X000000BD,0X000000BE,0X000000C0,0X000000C1,0X000000C2,0X000000C4,0X000000C5,0X000000C7,
0X000000C8,0X000000C9,0X000000CB,0X000000CC,0X000000CE,0X000000CF,0X000000D0,0X000000D2,
0X000000D3,0X000000D5,0X000000D6,0X000000D7,0X000000D9,0X000000DA,0X000000DC,0X000000DD,
0X000000DE,0X000000E0,0X000000E1,0X000000E3,0X000000E4,0X000000E5,0X000000E7,0X000000E8,
0X000000EA,0X000000EB,0X000000EC,0X000000EE,0X000000EF,0X000000F1,0X000000F2,0X000000F3,
0X000000F5,0X000000F6,0X000000F8,0X000000F9,0X000000FA,0X000000FC,0X000000FD,0X000000FF,
0X00000100,0X00000101,0X00000103,0X00000104,0X00000106,0X00000107,0X00000108,0X0000010A,
0X0000010B,0X0000010D,0X0000010E,0X0000010F,0X00000111,0X00000112,0X00000114,0X00000115,
0X00000116,0X00000118,0X00000119,0X0000011B,0X0000011C,0X0000011D,0X0000011F,0X00000120,
0X00000122,0X00000123,0X00000124,0X00000126,0X00000127,0X00000129,0X0000012A,0X0000012B,
0X0000012D,0X0000012E,0X00000130,0X00000131,0X00000132,0X00000134,0X00000135,0X00000137,
0X00000138,0X00000139,0X0000013B,0X0000013C,0X0000013E,0X0000013F,0X00000140,0X00000142,
0X00000143,0X00000145,0X00000146,0X00000148,0X00000149,0X0000014A,0X0000014C,0X0000014D,
0X0000014F,0X00000150,0X00000151,0X00000153,0X00000154,0X00000156,0X00000157,0X00000158,
0X0000015A,0X0000015B,0X0000015D,0X0000015E,0X0000015F,0X00000161,0X00000162,0X00000164,
0X00000165,0X00000166,0X00000168,0X00000169,0X0000016B,0X0000016C,0X0000016D,0X0000016F,
0X00000170,0X00000172,0X00000173,0X00000174,0X00000176,0X00000177,0X00000179,0X0000017A,
0X0000017B,0X0000017D,0X0000017E,0X00000180,0X00000181,0X00000182,0X00000184,0X00000185,
0X00000187,0X00000188,0X00000189,0X0000018B,0X0000018C,0X0000018E,0X0000018F,0X00000190,
0X00000192,0X00000193,0X00000195,0X00000196,0X00000197,0X00000199,0X0000019A,0X0000019C,
0X0000019D,0X0000019E,0X000001A0,0X000001A1,0X000001A3,0X000001A4,0X000001A5,0X000001A7,
0X000001A8,0X000001AA,0X000001AB,0X000001AC,0X000001AE,0X000001AF,0X000001B1,0X000001B2,
};
//Cb to Blue color conversion Look Up Table
const uint32_t CB_BLUE_LUT[]=
{
0X0000061D,0X0000061F,0X00000621,0X00000623,0X00000624,0X00000626,0X00000628,0X0000062A,
0X0000062B,0X0000062D,0X0000062F,0X00000631,0X00000632,0X00000634,0X00000636,0X00000638,
0X0000063A,0X0000063B,0X0000063D,0X0000063F,0X00000641,0X00000642,0X00000644,0X00000646,
0X00000648,0X00000649,0X0000064B,0X0000064D,0X0000064F,0X00000651,0X00000652,0X00000654,
0X00000656,0X00000658,0X00000659,0X0000065B,0X0000065D,0X0000065F,0X00000661,0X00000662,
0X00000664,0X00000666,0X00000668,0X00000669,0X0000066B,0X0000066D,0X0000066F,0X00000670,
0X00000672,0X00000674,0X00000676,0X00000678,0X00000679,0X0000067B,0X0000067D,0X0000067F,
0X00000680,0X00000682,0X00000684,0X00000686,0X00000688,0X00000689,0X0000068B,0X0000068D,
0X0000068F,0X00000690,0X00000692,0X00000694,0X00000696,0X00000697,0X00000699,0X0000069B,
0X0000069D,0X0000069F,0X000006A0,0X000006A2,0X000006A4,0X000006A6,0X000006A7,0X000006A9,
0X000006AB,0X000006AD,0X000006AE,0X000006B0,0X000006B2,0X000006B4,0X000006B6,0X000006B7,
0X000006B9,0X000006BB,0X000006BD,0X000006BE,0X000006C0,0X000006C2,0X000006C4,0X000006C6,
0X000006C7,0X000006C9,0X000006CB,0X000006CD,0X000006CE,0X000006D0,0X000006D2,0X000006D4,
0X000006D5,0X000006D7,0X000006D9,0X000006DB,0X000006DD,0X000006DE,0X000006E0,0X000006E2,
0X000006E4,0X000006E5,0X000006E7,0X000006E9,0X000006EB,0X000006ED,0X000006EE,0X000006F0,
0X000006F2,0X000006F4,0X000006F5,0X000006F7,0X000006F9,0X000006FB,0X000006FC,0X000006FE,
0X00000700,0X00000702,0X00000704,0X00000705,0X00000707,0X00000709,0X0000070B,0X0000070C,
0X0000070E,0X00000710,0X00000712,0X00000713,0X00000715,0X00000717,0X00000719,0X0000071B,
0X0000071C,0X0000071E,0X00000720,0X00000722,0X00000723,0X00000725,0X00000727,0X00000729,
0X0000072B,0X0000072C,0X0000072E,0X00000730,0X00000732,0X00000733,0X00000735,0X00000737,
0X00000739,0X0000073A,0X0000073C,0X0000073E,0X00000740,0X00000742,0X00000743,0X00000745,
0X00000747,0X00000749,0X0000074A,0X0000074C,0X0000074E,0X00000750,0X00000752,0X00000753,
0X00000755,0X00000757,0X00000759,0X0000075A,0X0000075C,0X0000075E,0X00000760,0X00000761,
0X00000763,0X00000765,0X00000767,0X00000769,0X0000076A,0X0000076C,0X0000076E,0X00000770,
0X00000771,0X00000773,0X00000775,0X00000777,0X00000778,0X0000077A,0X0000077C,0X0000077E,
0X00000780,0X00000781,0X00000783,0X00000785,0X00000787,0X00000788,0X0000078A,0X0000078C,
0X0000078E,0X00000790,0X00000791,0X00000793,0X00000795,0X00000797,0X00000798,0X0000079A,
0X0000079C,0X0000079E,0X0000079F,0X000007A1,0X000007A3,0X000007A5,0X000007A7,0X000007A8,
0X000007AA,0X000007AC,0X000007AE,0X000007AF,0X000007B1,0X000007B3,0X000007B5,0X000007B7,
0X000007B8,0X000007BA,0X000007BC,0X000007BE,0X000007BF,0X000007C1,0X000007C3,0X000007C5,
0X000007C6,0X000007C8,0X000007CA,0X000007CC,0X000007CE,0X000007CF,0X000007D1,0X000007D3,
0X000007D5,0X000007D6,0X000007D8,0X000007DA,0X000007DC,0X000007DD,0X000007DF,0X000007E1,
};
//Cr to Green color conversion Look Up Table
const uint32_t CR_GREEN_LUT[]=
{
0X025B6800,0X025AB130,0X0259FA60,0X02594390,0X02588CC0,0X0257D5F0,0X02571F20,0X02566850,
0X0255B180,0X0254FAB0,0X025443E0,0X02538D10,0X0252D640,0X02521F70,0X025168A0,0X0250B1D0,
0X024FFB00,0X024F4430,0X024E8D60,0X024DD690,0X024D1FC0,0X024C68F0,0X024BB220,0X024AFB50,
0X024A4480,0X02498DB0,0X0248D6E0,0X02482010,0X02476940,0X0246B270,0X0245FBA0,0X024544D0,
0X02448E00,0X0243D730,0X02432060,0X02426990,0X0241B2C0,0X0240FBF0,0X02404520,0X023F8E50,
0X023ED780,0X023E20B0,0X023D69E0,0X023CB310,0X023BFC40,0X023B4570,0X023A8EA0,0X0239D7D0,
0X02392100,0X02386A30,0X0237B360,0X0236FC90,0X023645C0,0X02358EF0,0X0234D820,0X02342150,
0X02336A80,0X0232B3B0,0X0231FCE0,0X02314610,0X02308F40,0X022FD870,0X022F21A0,0X022E6AD0,
0X022DB400,0X022CFD30,0X022C4660,0X022B8F90,0X022AD8C0,0X022A21F0,0X02296B20,0X0228B450,
0X0227FD80,0X022746B0,0X02268FE0,0X0225D910,0X02252240,0X02246B70,0X0223B4A0,0X0222FDD0,
0X02224700,0X02219030,0X0220D960,0X02202290,0X021F6BC0,0X021EB4F0,0X021DFE20,0X021D4750,
0X021C9080,0X021BD9B0,0X021B22E0,0X021A6C10,0X0219B540,0X0218FE70,0X021847A0,0X021790D0,
0X0216DA00,0X02162330,0X02156C60,0X0214B590,0X0213FEC0,0X021347F0,0X02129120,0X0211DA50,
0X02112380,0X02106CB0,0X020FB5E0,0X020EFF10,0X020E4840,0X020D9170,0X020CDAA0,0X020C23D0,
0X020B6D00,0X020AB630,0X0209FF60,0X02094890,0X020891C0,0X0207DAF0,0X02072420,0X02066D50,
0X0205B680,0X0204FFB0,0X020448E0,0X02039210,0X0202DB40,0X02022470,0X02016DA0,0X0200B6D0,
0X02000000,0X01FF4930,0X01FE9260,0X01FDDB90,0X01FD24C0,0X01FC6DF0,0X01FBB720,0X01FB0050,
0X01FA4980,0X01F992B0,0X01F8DBE0,0X01F82510,0X01F76E40,0X01F6B770,0X01F600A0,0X01F549D0,
0X01F49300,0X01F3DC30,0X01F32560,0X01F26E90,0X01F1B7C0,0X01F100F0,0X01F04A20,0X01EF9350,
0X01EEDC80,0X01EE25B0,0X01ED6EE0,0X01ECB810,0X01EC0140,0X01EB4A70,0X01EA93A0,0X01E9DCD0,
0X01E92600,0X01E86F30,0X01E7B860,0X01E70190,0X01E64AC0,0X01E593F0,0X01E4DD20,0X01E42650,
0X01E36F80,0X01E2B8B0,0X01E201E0,0X01E14B10,0X01E09440,0X01DFDD70,0X01DF26A0,0X01DE6FD0,
0X01DDB900,0X01DD0230,0X01DC4B60,0X01DB9490,0X01DADDC0,0X01DA26F0,0X01D97020,0X01D8B950,
0X01D80280,0X01D74BB0,0X01D694E0,0X01D5DE10,0X01D52740,0X01D47070,0X01D3B9A0,0X01D302D0,
0X01D24C00,0X01D19530,0X01D0DE60,0X01D02790,0X01CF70C0,0X01CEB9F0,0X01CE0320,0X01CD4C50,
0X01CC9580,0X01CBDEB0,0X01CB27E0,0X01CA7110,0X01C9BA40,0X01C90370,0X01C84CA0,0X01C795D0,
0X01C6DF00,0X01C62830,0X01C57160,0X01C4BA90,0X01C403C0,0X01C34CF0,0X01C29620,0X01C1DF50,
0X01C12880,0X01C071B0,0X01BFBAE0,0X01BF0410,0X01BE4D40,0X01BD9670,0X01BCDFA0,0X01BC28D0,
0X01BB7200,0X01BABB30,0X01BA0460,0X01B94D90,0X01B896C0,0X01B7DFF0,0X01B72920,0X01B67250,
0X01B5BB80,0X01B504B0,0X01B44DE0,0X01B39710,0X01B2E040,0X01B22970,0X01B172A0,0X01B0BBD0,
0X01B00500,0X01AF4E30,0X01AE9760,0X01ADE090,0X01AD29C0,0X01AC72F0,0X01ABBC20,0X01AB0550,
0X01AA4E80,0X01A997B0,0X01A8E0E0,0X01A82A10,0X01A77340,0X01A6BC70,0X01A605A0,0X01A54ED0,
};
//Cb to Green color conversion Look Up Table
const uint32_t CB_GREEN_LUT[]=
{
0X022C0C00,0X022BB3E8,0X022B5BD0,0X022B03B8,0X022AABA0,0X022A5388,0X0229FB70,0X0229A358,
0X02294B40,0X0228F328,0X02289B10,0X022842F8,0X0227EAE0,0X022792C8,0X02273AB0,0X0226E298,
0X02268A80,0X02263268,0X0225DA50,0X02258238,0X02252A20,0X0224D208,0X022479F0,0X022421D8,
0X0223C9C0,0X022371A8,0X02231990,0X0222C178,0X02226960,0X02221148,0X0221B930,0X02216118,
0X02210900,0X0220B0E8,0X022058D0,0X022000B8,0X021FA8A0,0X021F5088,0X021EF870,0X021EA058,
0X021E4840,0X021DF028,0X021D9810,0X021D3FF8,0X021CE7E0,0X021C8FC8,0X021C37B0,0X021BDF98,
0X021B8780,0X021B2F68,0X021AD750,0X021A7F38,0X021A2720,0X0219CF08,0X021976F0,0X02191ED8,
0X0218C6C0,0X02186EA8,0X02181690,0X0217BE78,0X02176660,0X02170E48,0X0216B630,0X02165E18,
0X02160600,0X0215ADE8,0X021555D0,0X0214FDB8,0X0214A5A0,0X02144D88,0X0213F570,0X02139D58,
0X02134540,0X0212ED28,0X02129510,0X02123CF8,0X0211E4E0,0X02118CC8,0X021134B0,0X0210DC98,
0X02108480,0X02102C68,0X020FD450,0X020F7C38,0X020F2420,0X020ECC08,0X020E73F0,0X020E1BD8,
0X020DC3C0,0X020D6BA8,0X020D1390,0X020CBB78,0X020C6360,0X020C0B48,0X020BB330,0X020B5B18,
0X020B0300,0X020AAAE8,0X020A52D0,0X0209FAB8,0X0209A2A0,0X02094A88,0X0208F270,0X02089A58,
0X02084240,0X0207EA28,0X02079210,0X020739F8,0X0206E1E0,0X020689C8,0X020631B0,0X0205D998,
0X02058180,0X02052968,0X0204D150,0X02047938,0X02042120,0X0203C908,0X020370F0,0X020318D8,
0X0202C0C0,0X020268A8,0X02021090,0X0201B878,0X02016060,0X02010848,0X0200B030,0X02005818,
0X02000000,0X01FFA7E8,0X01FF4FD0,0X01FEF7B8,0X01FE9FA0,0X01FE4788,0X01FDEF70,0X01FD9758,
0X01FD3F40,0X01FCE728,0X01FC8F10,0X01FC36F8,0X01FBDEE0,0X01FB86C8,0X01FB2EB0,0X01FAD698,
0X01FA7E80,0X01FA2668,0X01F9CE50,0X01F97638,0X01F91E20,0X01F8C608,0X01F86DF0,0X01F815D8,
0X01F7BDC0,0X01F765A8,0X01F70D90,0X01F6B578,0X01F65D60,0X01F60548,0X01F5AD30,0X01F55518,
0X01F4FD00,0X01F4A4E8,0X01F44CD0,0X01F3F4B8,0X01F39CA0,0X01F34488,0X01F2EC70,0X01F29458,
0X01F23C40,0X01F1E428,0X01F18C10,0X01F133F8,0X01F0DBE0,0X01F083C8,0X01F02BB0,0X01EFD398,
0X01EF7B80,0X01EF2368,0X01EECB50,0X01EE7338,0X01EE1B20,0X01EDC308,0X01ED6AF0,0X01ED12D8,
0X01ECBAC0,0X01EC62A8,0X01EC0A90,0X01EBB278,0X01EB5A60,0X01EB0248,0X01EAAA30,0X01EA5218,
0X01E9FA00,0X01E9A1E8,0X01E949D0,0X01E8F1B8,0X01E899A0,0X01E84188,0X01E7E970,0X01E79158,
0X01E73940,0X01E6E128,0X01E68910,0X01E630F8,0X01E5D8E0,0X01E580C8,0X01E528B0,0X01E4D098,
0X01E47880,0X01E42068,0X01E3C850,0X01E37038,0X01E31820,0X01E2C008,0X01E267F0,0X01E20FD8,
0X01E1B7C0,0X01E15FA8,0X01E10790,0X01E0AF78,0X01E05760,0X01DFFF48,0X01DFA730,0X01DF4F18,
0X01DEF700,0X01DE9EE8,0X01DE46D0,0X01DDEEB8,0X01DD96A0,0X01DD3E88,0X01DCE670,0X01DC8E58,
0X01DC3640,0X01DBDE28,0X01DB8610,0X01DB2DF8,0X01DAD5E0,0X01DA7DC8,0X01DA25B0,0X01D9CD98,
0X01D97580,0X01D91D68,0X01D8C550,0X01D86D38,0X01D81520,0X01D7BD08,0X01D764F0,0X01D70CD8,
0X01D6B4C0,0X01D65CA8,0X01D60490,0X01D5AC78,0X01D55460,0X01D4FC48,0X01D4A430,0X01D44C18,
};
#else	
const uint8_t CLAMP_LUT[]= 
{
	//限制范围:0xffffffff to 0xffffff00 
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	//限制范围:0x00 to 0xff  
	0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
	0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
	0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
	0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
	0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
	0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
	0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
	0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
	0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
	0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
	0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
	0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
	0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
	0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
	0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
	0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
	//限制范围:0x100 to 0x1ff
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
};
//Cr to Red color conversion Look Up Table
const uint32_t CR_RED_LUT[]=
{
0X0000004D,0X0000004E,0X0000004F,0X00000051,0X00000052,0X00000054,0X00000055,0X00000056,
0X00000058,0X00000059,0X0000005B,0X0000005C,0X0000005D,0X0000005F,0X00000060,0X00000062,
0X00000063,0X00000064,0X00000066,0X00000067,0X00000069,0X0000006A,0X0000006B,0X0000006D,
0X0000006E,0X00000070,0X00000071,0X00000072,0X00000074,0X00000075,0X00000077,0X00000078,
0X00000079,0X0000007B,0X0000007C,0X0000007E,0X0000007F,0X00000080,0X00000082,0X00000083,
0X00000085,0X00000086,0X00000087,0X00000089,0X0000008A,0X0000008C,0X0000008D,0X0000008E,
0X00000090,0X00000091,0X00000093,0X00000094,0X00000095,0X00000097,0X00000098,0X0000009A,
0X0000009B,0X0000009C,0X0000009E,0X0000009F,0X000000A1,0X000000A2,0X000000A3,0X000000A5,
0X000000A6,0X000000A8,0X000000A9,0X000000AA,0X000000AC,0X000000AD,0X000000AF,0X000000B0,
0X000000B1,0X000000B3,0X000000B4,0X000000B6,0X000000B7,0X000000B8,0X000000BA,0X000000BB,
0X000000BD,0X000000BE,0X000000C0,0X000000C1,0X000000C2,0X000000C4,0X000000C5,0X000000C7,
0X000000C8,0X000000C9,0X000000CB,0X000000CC,0X000000CE,0X000000CF,0X000000D0,0X000000D2,
0X000000D3,0X000000D5,0X000000D6,0X000000D7,0X000000D9,0X000000DA,0X000000DC,0X000000DD,
0X000000DE,0X000000E0,0X000000E1,0X000000E3,0X000000E4,0X000000E5,0X000000E7,0X000000E8,
0X000000EA,0X000000EB,0X000000EC,0X000000EE,0X000000EF,0X000000F1,0X000000F2,0X000000F3,
0X000000F5,0X000000F6,0X000000F8,0X000000F9,0X000000FA,0X000000FC,0X000000FD,0X000000FF,
0X00000100,0X00000101,0X00000103,0X00000104,0X00000106,0X00000107,0X00000108,0X0000010A,
0X0000010B,0X0000010D,0X0000010E,0X0000010F,0X00000111,0X00000112,0X00000114,0X00000115,
0X00000116,0X00000118,0X00000119,0X0000011B,0X0000011C,0X0000011D,0X0000011F,0X00000120,
0X00000122,0X00000123,0X00000124,0X00000126,0X00000127,0X00000129,0X0000012A,0X0000012B,
0X0000012D,0X0000012E,0X00000130,0X00000131,0X00000132,0X00000134,0X00000135,0X00000137,
0X00000138,0X00000139,0X0000013B,0X0000013C,0X0000013E,0X0000013F,0X00000140,0X00000142,
0X00000143,0X00000145,0X00000146,0X00000148,0X00000149,0X0000014A,0X0000014C,0X0000014D,
0X0000014F,0X00000150,0X00000151,0X00000153,0X00000154,0X00000156,0X00000157,0X00000158,
0X0000015A,0X0000015B,0X0000015D,0X0000015E,0X0000015F,0X00000161,0X00000162,0X00000164,
0X00000165,0X00000166,0X00000168,0X00000169,0X0000016B,0X0000016C,0X0000016D,0X0000016F,
0X00000170,0X00000172,0X00000173,0X00000174,0X00000176,0X00000177,0X00000179,0X0000017A,
0X0000017B,0X0000017D,0X0000017E,0X00000180,0X00000181,0X00000182,0X00000184,0X00000185,
0X00000187,0X00000188,0X00000189,0X0000018B,0X0000018C,0X0000018E,0X0000018F,0X00000190,
0X00000192,0X00000193,0X00000195,0X00000196,0X00000197,0X00000199,0X0000019A,0X0000019C,
0X0000019D,0X0000019E,0X000001A0,0X000001A1,0X000001A3,0X000001A4,0X000001A5,0X000001A7,
0X000001A8,0X000001AA,0X000001AB,0X000001AC,0X000001AE,0X000001AF,0X000001B1,0X000001B2,
};
//Cb to Blue color conversion Look Up Table
const uint32_t CB_BLUE_LUT[]=
{
0X0000001D,0X0000001F,0X00000021,0X00000023,0X00000024,0X00000026,0X00000028,0X0000002A,
0X0000002B,0X0000002D,0X0000002F,0X00000031,0X00000032,0X00000034,0X00000036,0X00000038,
0X0000003A,0X0000003B,0X0000003D,0X0000003F,0X00000041,0X00000042,0X00000044,0X00000046,
0X00000048,0X00000049,0X0000004B,0X0000004D,0X0000004F,0X00000051,0X00000052,0X00000054,
0X00000056,0X00000058,0X00000059,0X0000005B,0X0000005D,0X0000005F,0X00000061,0X00000062,
0X00000064,0X00000066,0X00000068,0X00000069,0X0000006B,0X0000006D,0X0000006F,0X00000070,
0X00000072,0X00000074,0X00000076,0X00000078,0X00000079,0X0000007B,0X0000007D,0X0000007F,
0X00000080,0X00000082,0X00000084,0X00000086,0X00000088,0X00000089,0X0000008B,0X0000008D,
0X0000008F,0X00000090,0X00000092,0X00000094,0X00000096,0X00000097,0X00000099,0X0000009B,
0X0000009D,0X0000009F,0X000000A0,0X000000A2,0X000000A4,0X000000A6,0X000000A7,0X000000A9,
0X000000AB,0X000000AD,0X000000AE,0X000000B0,0X000000B2,0X000000B4,0X000000B6,0X000000B7,
0X000000B9,0X000000BB,0X000000BD,0X000000BE,0X000000C0,0X000000C2,0X000000C4,0X000000C6,
0X000000C7,0X000000C9,0X000000CB,0X000000CD,0X000000CE,0X000000D0,0X000000D2,0X000000D4,
0X000000D5,0X000000D7,0X000000D9,0X000000DB,0X000000DD,0X000000DE,0X000000E0,0X000000E2,
0X000000E4,0X000000E5,0X000000E7,0X000000E9,0X000000EB,0X000000ED,0X000000EE,0X000000F0,
0X000000F2,0X000000F4,0X000000F5,0X000000F7,0X000000F9,0X000000FB,0X000000FC,0X000000FE,
0X00000100,0X00000102,0X00000104,0X00000105,0X00000107,0X00000109,0X0000010B,0X0000010C,
0X0000010E,0X00000110,0X00000112,0X00000113,0X00000115,0X00000117,0X00000119,0X0000011B,
0X0000011C,0X0000011E,0X00000120,0X00000122,0X00000123,0X00000125,0X00000127,0X00000129,
0X0000012B,0X0000012C,0X0000012E,0X00000130,0X00000132,0X00000133,0X00000135,0X00000137,
0X00000139,0X0000013A,0X0000013C,0X0000013E,0X00000140,0X00000142,0X00000143,0X00000145,
0X00000147,0X00000149,0X0000014A,0X0000014C,0X0000014E,0X00000150,0X00000152,0X00000153,
0X00000155,0X00000157,0X00000159,0X0000015A,0X0000015C,0X0000015E,0X00000160,0X00000161,
0X00000163,0X00000165,0X00000167,0X00000169,0X0000016A,0X0000016C,0X0000016E,0X00000170,
0X00000171,0X00000173,0X00000175,0X00000177,0X00000178,0X0000017A,0X0000017C,0X0000017E,
0X00000180,0X00000181,0X00000183,0X00000185,0X00000187,0X00000188,0X0000018A,0X0000018C,
0X0000018E,0X00000190,0X00000191,0X00000193,0X00000195,0X00000197,0X00000198,0X0000019A,
0X0000019C,0X0000019E,0X0000019F,0X000001A1,0X000001A3,0X000001A5,0X000001A7,0X000001A8,
0X000001AA,0X000001AC,0X000001AE,0X000001AF,0X000001B1,0X000001B3,0X000001B5,0X000001B7,
0X000001B8,0X000001BA,0X000001BC,0X000001BE,0X000001BF,0X000001C1,0X000001C3,0X000001C5,
0X000001C6,0X000001C8,0X000001CA,0X000001CC,0X000001CE,0X000001CF,0X000001D1,0X000001D3,
0X000001D5,0X000001D6,0X000001D8,0X000001DA,0X000001DC,0X000001DD,0X000001DF,0X000001E1,
};
//Cr to Green color conversion Look Up Table
const uint32_t CR_GREEN_LUT[]=
{
0X00DB6800,0X00DAB130,0X00D9FA60,0X00D94390,0X00D88CC0,0X00D7D5F0,0X00D71F20,0X00D66850,
0X00D5B180,0X00D4FAB0,0X00D443E0,0X00D38D10,0X00D2D640,0X00D21F70,0X00D168A0,0X00D0B1D0,
0X00CFFB00,0X00CF4430,0X00CE8D60,0X00CDD690,0X00CD1FC0,0X00CC68F0,0X00CBB220,0X00CAFB50,
0X00CA4480,0X00C98DB0,0X00C8D6E0,0X00C82010,0X00C76940,0X00C6B270,0X00C5FBA0,0X00C544D0,
0X00C48E00,0X00C3D730,0X00C32060,0X00C26990,0X00C1B2C0,0X00C0FBF0,0X00C04520,0X00BF8E50,
0X00BED780,0X00BE20B0,0X00BD69E0,0X00BCB310,0X00BBFC40,0X00BB4570,0X00BA8EA0,0X00B9D7D0,
0X00B92100,0X00B86A30,0X00B7B360,0X00B6FC90,0X00B645C0,0X00B58EF0,0X00B4D820,0X00B42150,
0X00B36A80,0X00B2B3B0,0X00B1FCE0,0X00B14610,0X00B08F40,0X00AFD870,0X00AF21A0,0X00AE6AD0,
0X00ADB400,0X00ACFD30,0X00AC4660,0X00AB8F90,0X00AAD8C0,0X00AA21F0,0X00A96B20,0X00A8B450,
0X00A7FD80,0X00A746B0,0X00A68FE0,0X00A5D910,0X00A52240,0X00A46B70,0X00A3B4A0,0X00A2FDD0,
0X00A24700,0X00A19030,0X00A0D960,0X00A02290,0X009F6BC0,0X009EB4F0,0X009DFE20,0X009D4750,
0X009C9080,0X009BD9B0,0X009B22E0,0X009A6C10,0X0099B540,0X0098FE70,0X009847A0,0X009790D0,
0X0096DA00,0X00962330,0X00956C60,0X0094B590,0X0093FEC0,0X009347F0,0X00929120,0X0091DA50,
0X00912380,0X00906CB0,0X008FB5E0,0X008EFF10,0X008E4840,0X008D9170,0X008CDAA0,0X008C23D0,
0X008B6D00,0X008AB630,0X0089FF60,0X00894890,0X008891C0,0X0087DAF0,0X00872420,0X00866D50,
0X0085B680,0X0084FFB0,0X008448E0,0X00839210,0X0082DB40,0X00822470,0X00816DA0,0X0080B6D0,
0X00800000,0X007F4930,0X007E9260,0X007DDB90,0X007D24C0,0X007C6DF0,0X007BB720,0X007B0050,
0X007A4980,0X007992B0,0X0078DBE0,0X00782510,0X00776E40,0X0076B770,0X007600A0,0X007549D0,
0X00749300,0X0073DC30,0X00732560,0X00726E90,0X0071B7C0,0X007100F0,0X00704A20,0X006F9350,
0X006EDC80,0X006E25B0,0X006D6EE0,0X006CB810,0X006C0140,0X006B4A70,0X006A93A0,0X0069DCD0,
0X00692600,0X00686F30,0X0067B860,0X00670190,0X00664AC0,0X006593F0,0X0064DD20,0X00642650,
0X00636F80,0X0062B8B0,0X006201E0,0X00614B10,0X00609440,0X005FDD70,0X005F26A0,0X005E6FD0,
0X005DB900,0X005D0230,0X005C4B60,0X005B9490,0X005ADDC0,0X005A26F0,0X00597020,0X0058B950,
0X00580280,0X00574BB0,0X005694E0,0X0055DE10,0X00552740,0X00547070,0X0053B9A0,0X005302D0,
0X00524C00,0X00519530,0X0050DE60,0X00502790,0X004F70C0,0X004EB9F0,0X004E0320,0X004D4C50,
0X004C9580,0X004BDEB0,0X004B27E0,0X004A7110,0X0049BA40,0X00490370,0X00484CA0,0X004795D0,
0X0046DF00,0X00462830,0X00457160,0X0044BA90,0X004403C0,0X00434CF0,0X00429620,0X0041DF50,
0X00412880,0X004071B0,0X003FBAE0,0X003F0410,0X003E4D40,0X003D9670,0X003CDFA0,0X003C28D0,
0X003B7200,0X003ABB30,0X003A0460,0X00394D90,0X003896C0,0X0037DFF0,0X00372920,0X00367250,
0X0035BB80,0X003504B0,0X00344DE0,0X00339710,0X0032E040,0X00322970,0X003172A0,0X0030BBD0,
0X00300500,0X002F4E30,0X002E9760,0X002DE090,0X002D29C0,0X002C72F0,0X002BBC20,0X002B0550,
0X002A4E80,0X002997B0,0X0028E0E0,0X00282A10,0X00277340,0X0026BC70,0X002605A0,0X00254ED0,
};
//Cb to Green color conversion Look Up Table
const uint32_t CB_GREEN_LUT[]=
{
0X00AC0C00,0X00ABB3E8,0X00AB5BD0,0X00AB03B8,0X00AAABA0,0X00AA5388,0X00A9FB70,0X00A9A358,
0X00A94B40,0X00A8F328,0X00A89B10,0X00A842F8,0X00A7EAE0,0X00A792C8,0X00A73AB0,0X00A6E298,
0X00A68A80,0X00A63268,0X00A5DA50,0X00A58238,0X00A52A20,0X00A4D208,0X00A479F0,0X00A421D8,
0X00A3C9C0,0X00A371A8,0X00A31990,0X00A2C178,0X00A26960,0X00A21148,0X00A1B930,0X00A16118,
0X00A10900,0X00A0B0E8,0X00A058D0,0X00A000B8,0X009FA8A0,0X009F5088,0X009EF870,0X009EA058,
0X009E4840,0X009DF028,0X009D9810,0X009D3FF8,0X009CE7E0,0X009C8FC8,0X009C37B0,0X009BDF98,
0X009B8780,0X009B2F68,0X009AD750,0X009A7F38,0X009A2720,0X0099CF08,0X009976F0,0X00991ED8,
0X0098C6C0,0X00986EA8,0X00981690,0X0097BE78,0X00976660,0X00970E48,0X0096B630,0X00965E18,
0X00960600,0X0095ADE8,0X009555D0,0X0094FDB8,0X0094A5A0,0X00944D88,0X0093F570,0X00939D58,
0X00934540,0X0092ED28,0X00929510,0X00923CF8,0X0091E4E0,0X00918CC8,0X009134B0,0X0090DC98,
0X00908480,0X00902C68,0X008FD450,0X008F7C38,0X008F2420,0X008ECC08,0X008E73F0,0X008E1BD8,
0X008DC3C0,0X008D6BA8,0X008D1390,0X008CBB78,0X008C6360,0X008C0B48,0X008BB330,0X008B5B18,
0X008B0300,0X008AAAE8,0X008A52D0,0X0089FAB8,0X0089A2A0,0X00894A88,0X0088F270,0X00889A58,
0X00884240,0X0087EA28,0X00879210,0X008739F8,0X0086E1E0,0X008689C8,0X008631B0,0X0085D998,
0X00858180,0X00852968,0X0084D150,0X00847938,0X00842120,0X0083C908,0X008370F0,0X008318D8,
0X0082C0C0,0X008268A8,0X00821090,0X0081B878,0X00816060,0X00810848,0X0080B030,0X00805818,
0X00800000,0X007FA7E8,0X007F4FD0,0X007EF7B8,0X007E9FA0,0X007E4788,0X007DEF70,0X007D9758,
0X007D3F40,0X007CE728,0X007C8F10,0X007C36F8,0X007BDEE0,0X007B86C8,0X007B2EB0,0X007AD698,
0X007A7E80,0X007A2668,0X0079CE50,0X00797638,0X00791E20,0X0078C608,0X00786DF0,0X007815D8,
0X0077BDC0,0X007765A8,0X00770D90,0X0076B578,0X00765D60,0X00760548,0X0075AD30,0X00755518,
0X0074FD00,0X0074A4E8,0X00744CD0,0X0073F4B8,0X00739CA0,0X00734488,0X0072EC70,0X00729458,
0X00723C40,0X0071E428,0X00718C10,0X007133F8,0X0070DBE0,0X007083C8,0X00702BB0,0X006FD398,
0X006F7B80,0X006F2368,0X006ECB50,0X006E7338,0X006E1B20,0X006DC308,0X006D6AF0,0X006D12D8,
0X006CBAC0,0X006C62A8,0X006C0A90,0X006BB278,0X006B5A60,0X006B0248,0X006AAA30,0X006A5218,
0X0069FA00,0X0069A1E8,0X006949D0,0X0068F1B8,0X006899A0,0X00684188,0X0067E970,0X00679158,
0X00673940,0X0066E128,0X00668910,0X006630F8,0X0065D8E0,0X006580C8,0X006528B0,0X0064D098,
0X00647880,0X00642068,0X0063C850,0X00637038,0X00631820,0X0062C008,0X006267F0,0X00620FD8,
0X0061B7C0,0X00615FA8,0X00610790,0X0060AF78,0X00605760,0X005FFF48,0X005FA730,0X005F4F18,
0X005EF700,0X005E9EE8,0X005E46D0,0X005DEEB8,0X005D96A0,0X005D3E88,0X005CE670,0X005C8E58,
0X005C3640,0X005BDE28,0X005B8610,0X005B2DF8,0X005AD5E0,0X005A7DC8,0X005A25B0,0X0059CD98,
0X00597580,0X00591D68,0X0058C550,0X00586D38,0X00581520,0X0057BD08,0X005764F0,0X00570CD8,
0X0056B4C0,0X00565CA8,0X00560490,0X0055AC78,0X00555460,0X0054FC48,0X0054A430,0X00544C18,
};
#endif

JPEG_MCU_RGB_ConvertorTypeDef JPEG_ConvertorParams;	

 uint32_t JPEG_MCU_YCbCr420_ARGB_ConvertBlocks( uint8_t *pInBuffer, uint8_t *pOutBuffer, uint32_t BlockIndex, uint32_t DataCount)
{  
	 uint32_t numberMCU;
	 uint32_t i,j,k, currentMCU, xRef,yRef;
	 uint32_t refline; 
	int ycomp, crcomp, cbcomp;
	int c_red, c_blue, c_green;
	 uint8_t *pOutAddr, *pOutAddr2;
	 uint8_t *pChrom,*pLum;  
	numberMCU=DataCount/YCBCR_420_BLOCK_SIZE;
	currentMCU=BlockIndex; 
	while(currentMCU<(numberMCU+BlockIndex))
	{
		xRef=((currentMCU*16)/JPEG_ConvertorParams.WidthExtend)*16;
		yRef=((currentMCU*16)%JPEG_ConvertorParams.WidthExtend);
		refline=JPEG_ConvertorParams.ScaledWidth*xRef+(JPEG_BYTES_PER_PIXEL*yRef);
		currentMCU++;
		pChrom=pInBuffer+256;	//pChroma=pInBuffer+4*64
		pLum=pInBuffer;
		for(i=0;i<16;i+=2)
		{
			if(i==8)pLum=pInBuffer+128;
			if(refline<JPEG_ConvertorParams.ImageSize_Bytes)
			{
				pOutAddr=pOutBuffer+refline;
				pOutAddr2=pOutAddr+JPEG_ConvertorParams.ScaledWidth;
				for(k=0;k<2;k++)
				{
					for(j=0;j<8;j+=2)
					{     
						cbcomp=(int)(*(pChrom));
						c_blue=(int)(*(CB_BLUE_LUT+cbcomp));
						crcomp=(int)(*(pChrom+64));
						c_red=(int)(*(CR_RED_LUT+crcomp));
						c_green=(((int)(*(CR_GREEN_LUT+crcomp))+(int)(*(CB_GREEN_LUT+cbcomp)))>>16); 
#if JPEG_BYTES_PER_PIXEL==4		//ARGB_8888颜色格式   				
						ycomp=(int)(*(pLum+j)); 
						*(volatile uint32_t*)pOutAddr=
						(CLAMP(ycomp+c_red)<<JPEG_RED_OFFSET)|\
						(CLAMP(ycomp+c_green)<<JPEG_GREEN_OFFSET)|\
						(CLAMP(ycomp+c_blue)<<JPEG_BLUE_OFFSET); 
						ycomp=(int)(*(pLum+j+1)); 
						*((volatile uint32_t*)(pOutAddr+4))=
						(CLAMP(ycomp+c_red)<<JPEG_RED_OFFSET)|\
						(CLAMP(ycomp+c_green)<<JPEG_GREEN_OFFSET)|\
						(CLAMP(ycomp+c_blue)<<JPEG_BLUE_OFFSET); 
						ycomp=(int)(*(pLum+j+8)); 
						*(volatile uint32_t*)pOutAddr2=
						(CLAMP(ycomp+c_red)<<JPEG_RED_OFFSET)|\
						(CLAMP(ycomp+c_green)<<JPEG_GREEN_OFFSET)|\
						(CLAMP(ycomp+c_blue)<<JPEG_BLUE_OFFSET); 
						ycomp=(int)(*(pLum+j+8+1)); 
						*((volatile uint32_t*)(pOutAddr2+4))=
						(CLAMP(ycomp+c_red)<<JPEG_RED_OFFSET)|\
						(CLAMP(ycomp+c_green)<<JPEG_GREEN_OFFSET)|\
						(CLAMP(ycomp+c_blue)<<JPEG_BLUE_OFFSET); 
#elif JPEG_BYTES_PER_PIXEL==3	//RGB_888颜色格式  
						ycomp=(int)(*(pLum+j)); 
						pOutAddr[JPEG_RED_OFFSET/8]=CLAMP(ycomp+c_red);
						pOutAddr[JPEG_GREEN_OFFSET/8]=CLAMP(ycomp+c_green);
						pOutAddr[JPEG_BLUE_OFFSET/8]=CLAMP(ycomp+c_blue); 
						ycomp=(int)(*(pLum+j+1)); 
						pOutAddr[3+JPEG_RED_OFFSET/8]=CLAMP(ycomp+c_red);
						pOutAddr[3+JPEG_GREEN_OFFSET/8]=CLAMP(ycomp+c_green);
						pOutAddr[3+JPEG_BLUE_OFFSET/8]=CLAMP(ycomp+c_blue); 
						ycomp=(int)(*(pLum+j+8)); 
						pOutAddr2[JPEG_RED_OFFSET/8] = CLAMP(ycomp + c_red);
						pOutAddr2[JPEG_GREEN_OFFSET/8] = CLAMP(ycomp + c_green);
						pOutAddr2[JPEG_BLUE_OFFSET/8] = CLAMP(ycomp + c_blue); 
						ycomp=(int)(*(pLum+j+8+1));   
						pOutAddr2[3+JPEG_RED_OFFSET/8]=CLAMP(ycomp+c_red);
						pOutAddr2[3+JPEG_GREEN_OFFSET/8]=CLAMP(ycomp+c_green);
						pOutAddr2[3+JPEG_BLUE_OFFSET/8]=CLAMP(ycomp+c_blue);
#elif JPEG_BYTES_PER_PIXEL==2	//RGB_565颜色格式 
						ycomp=(int)(*(pLum+j));   
						*(volatile uint16_t*)pOutAddr=CLAMP(ycomp+c_red)|CLAMP(ycomp+c_green)|CLAMP(ycomp+c_blue);
						ycomp=(int)(*(pLum+j+1)); 
						*((volatile uint16_t*)pOutAddr+1)=CLAMP(ycomp+c_red)|CLAMP(ycomp+c_green)|CLAMP(ycomp+c_blue);
						ycomp=(int)(*(pLum+j+8)); 
						*(volatile uint16_t*)pOutAddr2=CLAMP(ycomp+c_red)|CLAMP(ycomp+c_green)|CLAMP(ycomp+c_blue);
 						ycomp=(int)(*(pLum+j+8+1));   
						*((volatile uint16_t*)pOutAddr2+1)=CLAMP(ycomp+c_red)|CLAMP(ycomp+c_green)|CLAMP(ycomp+c_blue); 
#endif  
						pOutAddr+=JPEG_BYTES_PER_PIXEL*2;
						pOutAddr2+=JPEG_BYTES_PER_PIXEL*2;
						pChrom++;
					}
					pLum+=64;                  
				} 
				pLum=pLum-128+16; 
				refline+=JPEG_ConvertorParams.ScaledWidth*2; 
			}
		} 
		pInBuffer+=YCBCR_420_BLOCK_SIZE;
	}
	return numberMCU;
} 

 uint32_t JPEG_MCU_YCbCr422_ARGB_ConvertBlocks( uint8_t *pInBuffer, uint8_t *pOutBuffer, uint32_t BlockIndex, uint32_t DataCount)
{  
	 uint32_t numberMCU;
	 uint32_t i,j,k,currentMCU,xRef,yRef;
	 uint32_t refline; 
	int ycomp,crcomp,cbcomp;
	int c_red,c_blue,c_green;
	 uint8_t *pOutAddr;
	 uint8_t *pChrom,*pLum;
	numberMCU=DataCount/YCBCR_422_BLOCK_SIZE;
	currentMCU=BlockIndex;
	while(currentMCU<(numberMCU+BlockIndex))
	{
		xRef=((currentMCU*16)/JPEG_ConvertorParams.WidthExtend)*8;
		yRef=((currentMCU*16)%JPEG_ConvertorParams.WidthExtend);
		refline=JPEG_ConvertorParams.ScaledWidth*xRef+(JPEG_BYTES_PER_PIXEL*yRef);
		currentMCU++;
		pChrom=pInBuffer+128;	//pChroma=pInBuffer+2*64
		pLum=pInBuffer;
		for(i=0;i<8;i++)
		{
			if(refline<JPEG_ConvertorParams.ImageSize_Bytes)
			{
				pOutAddr=pOutBuffer+refline;
				for(k=0;k<2;k++)
				{
					for(j=0;j<8;j+=2)
					{
						cbcomp=(int)(*(pChrom));
						c_blue=(int)(*(CB_BLUE_LUT+cbcomp));
						crcomp=(int)(*(pChrom+64));
						c_red=(int)(*(CR_RED_LUT+crcomp));
						c_green=((int)(*(CR_GREEN_LUT+crcomp))+(int)(*(CR_GREEN_LUT+cbcomp)))>>16;
#if JPEG_BYTES_PER_PIXEL==4		//ARGB_8888颜色格式    
						ycomp=(int)(*(pLum+j)); 
						*(volatile uint32_t*)pOutAddr=
						(CLAMP(ycomp+c_red)<<JPEG_RED_OFFSET)|\
						(CLAMP(ycomp+c_green)<<JPEG_GREEN_OFFSET)|\
						(CLAMP(ycomp+c_blue)<<JPEG_BLUE_OFFSET); 
						ycomp=(int)(*(pLum+j+1)); 
						*((volatile uint32_t*)(pOutAddr+4))=
						(CLAMP(ycomp+c_red)<<JPEG_RED_OFFSET)|\
						(CLAMP(ycomp+c_green)<<JPEG_GREEN_OFFSET)|\
						(CLAMP(ycomp+c_blue)<<JPEG_BLUE_OFFSET);   
#elif JPEG_BYTES_PER_PIXEL==3	//RGB_888颜色格式  
						ycomp=(int)(*(pLum+j));
						pOutAddr[JPEG_RED_OFFSET/8]=CLAMP(ycomp+c_red);
						pOutAddr[JPEG_GREEN_OFFSET/8]=CLAMP(ycomp+c_green);
						pOutAddr[JPEG_BLUE_OFFSET/8]=CLAMP(ycomp+c_blue);
						ycomp=(int)(*(pLum+j+1));
						pOutAddr[3+JPEG_RED_OFFSET/8]=CLAMP(ycomp+c_red);
						pOutAddr[3+JPEG_GREEN_OFFSET/8]=CLAMP(ycomp+c_green);
						pOutAddr[3+JPEG_BLUE_OFFSET/8]=CLAMP(ycomp+c_blue);
#elif JPEG_BYTES_PER_PIXEL==2	//RGB_565颜色格式  
						ycomp=(int)(*(pLum+j)); 
						*(volatile uint16_t*)pOutAddr=CLAMP(ycomp+c_red)|CLAMP(ycomp+c_green)|CLAMP(ycomp+c_blue); 
						ycomp=(int)(*(pLum+j+1)); 
						*((volatile uint16_t*)pOutAddr+1)=CLAMP(ycomp+c_red)|CLAMP(ycomp+c_green)|CLAMP(ycomp+c_blue); 
#endif
						pOutAddr+=JPEG_BYTES_PER_PIXEL*2;
						pChrom++;
					}
					pLum+=64;                   
				}
				pLum=pLum-128+8;
				refline+=JPEG_ConvertorParams.ScaledWidth;        
			}
		}   
		pInBuffer+=YCBCR_422_BLOCK_SIZE;
	}
	return numberMCU;
}

 uint32_t JPEG_MCU_YCbCr444_ARGB_ConvertBlocks( uint8_t *pInBuffer, uint8_t *pOutBuffer, uint32_t BlockIndex, uint32_t DataCount)
{  
	 uint32_t numberMCU;
	 uint32_t i,j, currentMCU, xRef,yRef; 
	 uint32_t refline; 
	int ycomp, crcomp, cbcomp; 
	int c_red, c_blue, c_green; 
	 uint8_t *pOutAddr;
	 uint8_t *pChrom, *pLum; 
	numberMCU=DataCount/YCBCR_444_BLOCK_SIZE;
	currentMCU=BlockIndex;
	while(currentMCU<(numberMCU+BlockIndex))
	{ 
		xRef=((currentMCU*8)/JPEG_ConvertorParams.WidthExtend)*8;
		yRef=((currentMCU*8)%JPEG_ConvertorParams.WidthExtend);
		refline=JPEG_ConvertorParams.ScaledWidth*xRef+(JPEG_BYTES_PER_PIXEL*yRef);
		currentMCU++;
		pChrom=pInBuffer+64;//pChroma=pInBuffer+4*64 
		pLum=pInBuffer;

		for(i=0;i<8;i++)
		{
			if(refline<JPEG_ConvertorParams.ImageSize_Bytes)
			{
				pOutAddr=pOutBuffer+refline;
				for(j=0;j<8;j++)
				{
					cbcomp=(int)(*pChrom);
					c_blue=(int)(*(CB_BLUE_LUT+cbcomp)); 
					crcomp=(int)(*(pChrom+64));
					c_red=(int)(*(CR_RED_LUT+crcomp));    
					c_green=((int)(*(CR_GREEN_LUT+crcomp))+(int)(*(CB_GREEN_LUT+cbcomp)))>>16; 
#if JPEG_BYTES_PER_PIXEL==4		//ARGB_8888颜色格式    
					ycomp=(int)(*(pLum+j)); 
					*(volatile uint32_t*)pOutAddr=
					(CLAMP(ycomp+c_red)<<JPEG_RED_OFFSET)|\
					(CLAMP(ycomp+c_green)<<JPEG_GREEN_OFFSET)|\
					(CLAMP(ycomp+c_blue)<<JPEG_BLUE_OFFSET);    
#elif JPEG_BYTES_PER_PIXEL==3	//RGB_888颜色格式   
					ycomp=(int)(*(pLum+j)); 
					pOutAddr[JPEG_RED_OFFSET/8]=CLAMP(ycomp+c_red);
					pOutAddr[JPEG_GREEN_OFFSET/8]=CLAMP(ycomp+c_green);
					pOutAddr[JPEG_BLUE_OFFSET/8]=CLAMP(ycomp+c_blue);   
#elif JPEG_BYTES_PER_PIXEL==2	//RGB_565颜色格式 
					ycomp=(int)(*(pLum+j)); 
					*(volatile uint16_t*)pOutAddr=CLAMP(ycomp+c_red)|CLAMP(ycomp+c_green)|CLAMP(ycomp+c_blue); 
#endif   			 
					pOutAddr+=JPEG_BYTES_PER_PIXEL; 
					pChrom++;
				}
				pLum+=8;
				refline+=JPEG_ConvertorParams.ScaledWidth;      
			}
		}   
		pInBuffer+=YCBCR_444_BLOCK_SIZE;
	}
	return numberMCU;
}

 uint32_t JPEG_MCU_Gray_ARGB_ConvertBlocks( uint8_t *pInBuffer, uint8_t *pOutBuffer, uint32_t BlockIndex, uint32_t DataCount)
{
	 uint32_t numberMCU;
	 uint32_t  currentMCU, xRef,yRef;
	 uint32_t refline;
	 uint32_t i,j, ySample;
	 uint8_t *pOutAddr,*pLum; 
	numberMCU=DataCount/GRAY_444_BLOCK_SIZE;
	currentMCU=BlockIndex; 
	while(currentMCU<(numberMCU+BlockIndex))
	{
		xRef=((currentMCU*8)/JPEG_ConvertorParams.WidthExtend)*8;
		yRef=((currentMCU*8)%JPEG_ConvertorParams.WidthExtend);
		refline=JPEG_ConvertorParams.ScaledWidth*xRef+(JPEG_BYTES_PER_PIXEL*yRef);
		currentMCU++;
		pLum=pInBuffer;
		for(i=0;i<8;i++)
		{
			pOutAddr=pOutBuffer+refline;
			if(refline<JPEG_ConvertorParams.ImageSize_Bytes)
			{
				for(j=0;j<8;j++)
				{
					ySample=( uint32_t)(*pLum); 
#if JPEG_BYTES_PER_PIXEL==4		//ARGB_8888颜色格式    
					*(volatile uint32_t*)pOutAddr=ySample|(ySample<<8)|(ySample<<16); 
#elif JPEG_BYTES_PER_PIXEL==3	//RGB_888颜色格式  
					pOutAddr[0]=ySample;
					pOutAddr[1]=ySample;
					pOutAddr[2]=ySample; 
#elif JPEG_BYTES_PER_PIXEL==2	//RGB_565颜色格式
					*(volatile uint16_t*)pOutAddr=(ySample&0XF8)<<8|(ySample&0XFC)<<3|ySample>>3;
#endif   
					pOutAddr+=JPEG_BYTES_PER_PIXEL;
					pLum++;
				}
				refline+=JPEG_ConvertorParams.ScaledWidth;    
			}
		} 
		pInBuffer+=GRAY_444_BLOCK_SIZE;    
	}
	return numberMCU;
}


 uint32_t JPEG_MCU_YCCK_ARGB_ConvertBlocks( uint8_t *pInBuffer, uint8_t *pOutBuffer, uint32_t BlockIndex, uint32_t DataCount)
{  
	 uint32_t numberMCU;
	 uint32_t i,j, currentMCU, xRef,yRef;
	 uint32_t refline;
	int color_k;
	int c_red, c_blue, c_green;
	 uint8_t *pOutAddr,*pChrom;
	numberMCU=DataCount/CMYK_444_BLOCK_SIZE;
	currentMCU=BlockIndex;
	while(currentMCU<(numberMCU+BlockIndex))
	{
		xRef=((currentMCU*8)/JPEG_ConvertorParams.WidthExtend)*8;
		yRef=((currentMCU*8)%JPEG_ConvertorParams.WidthExtend);
		refline=JPEG_ConvertorParams.ScaledWidth*xRef+(JPEG_BYTES_PER_PIXEL*yRef);
		currentMCU++;
		pChrom=pInBuffer;
		for(i=0;i<8;i++)
		{
			if(refline<JPEG_ConvertorParams.ImageSize_Bytes)
			{
				pOutAddr=pOutBuffer+refline;     
				for(j=0;j<8;j++)
				{      
					color_k=(int)(*(pChrom+192));
					c_red=(color_k*((int)(*pChrom)))/255;
					c_green=(color_k*(int)(*(pChrom+64)))/255;
					c_blue=(color_k*(int)(*(pChrom+128)))/255;
#if JPEG_BYTES_PER_PIXEL==4		//ARGB_8888颜色格式    
					*(volatile uint32_t*)pOutAddr=
					(c_red<<JPEG_RED_OFFSET)|\
					(c_green<<JPEG_GREEN_OFFSET)|\
					(c_blue<<JPEG_BLUE_OFFSET);
#elif JPEG_BYTES_PER_PIXEL==3	//RGB_888颜色格式  
					pOutAddr[JPEG_RED_OFFSET/8]=c_red;
					pOutAddr[JPEG_GREEN_OFFSET/8]=c_green;
					pOutAddr[JPEG_BLUE_OFFSET/8]=c_blue;  
#elif JPEG_BYTES_PER_PIXEL==2	//RGB_565颜色格式 
					*(volatile uint16_t*)pOutAddr=(c_red&0XF8)<<8|(c_green&0XFC)<<3|c_blue>>3;
#endif      
					pOutAddr+=JPEG_BYTES_PER_PIXEL; 
					pChrom++;
				} 
				refline+=JPEG_ConvertorParams.ScaledWidth;        
			}
		}    
		pInBuffer+=CMYK_444_BLOCK_SIZE;
	}
	return numberMCU;
}

 uint8_t JPEG_GetDecodeColorConvertFunc(JPEG_ConfTypeDef *pJpegInfo, JPEG_YCbCrToRGB_Convert_Function *pFunction,  uint32_t *ImageNbMCUs)
{
	 uint32_t hMCU, vMCU;
	JPEG_ConvertorParams.ColorSpace=pJpegInfo->ColorSpace;				//色彩空间
	JPEG_ConvertorParams.ImageWidth=pJpegInfo->ImageWidth;				//图像宽度
	JPEG_ConvertorParams.ImageHeight=pJpegInfo->ImageHeight;			//图像高度
	JPEG_ConvertorParams.ImageSize_Bytes=pJpegInfo->ImageWidth*pJpegInfo->ImageHeight*JPEG_BYTES_PER_PIXEL;	//转换后的图像总字节数
	JPEG_ConvertorParams.ChromaSubsampling=pJpegInfo->ChromaSubsampling;//抽样情况
	if(JPEG_ConvertorParams.ColorSpace==JPEG_YCBCR_COLORSPACE)			//YCBCR颜色空间
	{
		if(JPEG_ConvertorParams.ChromaSubsampling==JPEG_420_SUBSAMPLING)
		{
			*pFunction=JPEG_MCU_YCbCr420_ARGB_ConvertBlocks;			//使用YCbCr420转换
			JPEG_ConvertorParams.LineOffset=JPEG_ConvertorParams.ImageWidth%16;
			if(JPEG_ConvertorParams.LineOffset!=0)
			{
				JPEG_ConvertorParams.LineOffset=16-JPEG_ConvertorParams.LineOffset;
			}
			JPEG_ConvertorParams.H_factor=16;
			JPEG_ConvertorParams.V_factor=16;
		}else if(JPEG_ConvertorParams.ChromaSubsampling==JPEG_422_SUBSAMPLING)
		{
			*pFunction=JPEG_MCU_YCbCr422_ARGB_ConvertBlocks;			//使用YCbCr422转换
 			JPEG_ConvertorParams.LineOffset=JPEG_ConvertorParams.ImageWidth%16;
			if(JPEG_ConvertorParams.LineOffset!=0)
			{
				JPEG_ConvertorParams.LineOffset=16-JPEG_ConvertorParams.LineOffset;
			}
			JPEG_ConvertorParams.H_factor=16;
			JPEG_ConvertorParams.V_factor=8;
		}else		//4:4:4
		{
			*pFunction=JPEG_MCU_YCbCr444_ARGB_ConvertBlocks;			//使用YCbCr444转换
 			JPEG_ConvertorParams.LineOffset=JPEG_ConvertorParams.ImageWidth%8;
			if(JPEG_ConvertorParams.LineOffset!=0)
			{
				JPEG_ConvertorParams.LineOffset=8-JPEG_ConvertorParams.LineOffset;
			}
			JPEG_ConvertorParams.H_factor=8;
			JPEG_ConvertorParams.V_factor=8;
		}
	}else if(JPEG_ConvertorParams.ColorSpace==JPEG_GRAYSCALE_COLORSPACE)//GrayScale颜色空间
	{
		*pFunction=JPEG_MCU_Gray_ARGB_ConvertBlocks;					//使用Y Gray转换
		JPEG_ConvertorParams.LineOffset=JPEG_ConvertorParams.ImageWidth%8;
		if(JPEG_ConvertorParams.LineOffset!=0)
		{
			JPEG_ConvertorParams.LineOffset=8-JPEG_ConvertorParams.LineOffset;
		}
		JPEG_ConvertorParams.H_factor=8;
		JPEG_ConvertorParams.V_factor=8;
	}else if(JPEG_ConvertorParams.ColorSpace==JPEG_CMYK_COLORSPACE)		//CMYK颜色空间
	{
		*pFunction=JPEG_MCU_YCCK_ARGB_ConvertBlocks;					//使用CMYK颜色转换
		JPEG_ConvertorParams.LineOffset=JPEG_ConvertorParams.ImageWidth%8; 
		if(JPEG_ConvertorParams.LineOffset!=0)
		{
			JPEG_ConvertorParams.LineOffset=8-JPEG_ConvertorParams.LineOffset;
		}
		JPEG_ConvertorParams.H_factor=8;
		JPEG_ConvertorParams.V_factor=8;
	}else return 0X01;	//不支持的颜色空间  
	JPEG_ConvertorParams.WidthExtend=JPEG_ConvertorParams.ImageWidth+JPEG_ConvertorParams.LineOffset;
	JPEG_ConvertorParams.ScaledWidth=JPEG_BYTES_PER_PIXEL*JPEG_ConvertorParams.ImageWidth;
	hMCU=(JPEG_ConvertorParams.ImageWidth/JPEG_ConvertorParams.H_factor);
	if((JPEG_ConvertorParams.ImageWidth%JPEG_ConvertorParams.H_factor)!=0)hMCU++;	//+1 for horizenatl incomplete MCU   
	vMCU=(JPEG_ConvertorParams.ImageHeight/JPEG_ConvertorParams.V_factor);
	if((JPEG_ConvertorParams.ImageHeight%JPEG_ConvertorParams.V_factor)!=0)vMCU++;	//+1 for vertical incomplete MCU  
	JPEG_ConvertorParams.MCU_Total_Nb=(hMCU*vMCU);
	*ImageNbMCUs=JPEG_ConvertorParams.MCU_Total_Nb;
	return 0X00;
}
#endif
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
